package org.bai.algorithm.entity;

public class ListNode<T> {

    public T val;

    public ListNode<T> pre;

    public ListNode<T> next;

    @Override
    public String toString() {
        return null == val ? null : String.valueOf(val);
    }

    public ListNode<T>
    buildNext() {
        ListNode<T> next = new ListNode<>();
        this.next = next;
        next.pre = this;
        return next;
    }

    public ListNode() {
    }

    public ListNode(T val) {
        this.val = val;
    }
}
